from django.urls import re_path
from .views import views,lable,reply
from .views import big
urlpatterns = [
    re_path(r'^questions/$',views.QuestionAPIview.as_view()),
    re_path(r'^questions/(?P<id>\d+)/$',views.QuestionAPIview.as_view()),
    re_path(r'^questions/(?P<id>\d+)/useful/$',views.QuestionYesView.as_view()),
    re_path(r'^questions/(?P<id>\d+)/unuseful/$',views.QuestionNoView.as_view()),
    re_path(r'^labels/(?P<id>\d+)/$',lable.LabelView.as_view()),
    re_path(r'^reply/$',reply.ReplyAPIView.as_view()),
    re_path(r'^reply/(?P<id>\d+)/useful/$',reply.ReplyYesAPIView.as_view()),
    re_path(r'^reply/(?P<id>\d+)/unuseful/$',reply.ReplyNoAPIView.as_view()),
    re_path(r'^labels/(?P<id>\d+)/focusin/$',lable.LabelfocusinAPIView.as_view()),
    re_path(r'^labels/(?P<id>\d+)/focusout/$',lable.LabelfocusoutAPIView.as_view()),
    re_path(r'^spit/(?P<id>\d+)/updatethumbup/$',big.SpitThumbupAPIView.as_view()),
    re_path(r'^spit/(?P<id>\d+)/collect/$',big.SpitCollectAPIView.as_view()),
    # re_path(r'^spit/$', big.SpitViewSet.as_view({
    #     'get': 'list',
    #     'post': 'create'
    # })),
    # re_path(r'^spit/{id}/updatethumbup/$', big.SpitViewSet.as_view({
    #     'put': 'update_thumbup',
    #
    # })),
    # re_path(r'^spit/{id}/collect/$', big.SpitViewSet.as_view({
    #     'put': 'collect'
    # }))
]

from rest_framework.routers import DefaultRouter

router =DefaultRouter()
router.register('spit',big.SpitViewSet,basename='1')
urlpatterns += router.urls